package com.tuo.beans;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author tuo
 *         订单信息表
 */
@Entity
public class Orders {
    private long id;
    /**
     * 客户ID
     */
    private long cusId;
    /**
     * 订单结束后统计应收金额
     */
    private BigDecimal price;
    /**
     * 押金
     */
    private BigDecimal deposit;
    /**
     * 预付款
     */
    private BigDecimal advance;
    /**
     * 欠款
     */
    private BigDecimal arrears;
    /**
     * 优惠
     */
    private BigDecimal discount;
    /**
     * 实付款
     */
    private BigDecimal paid;
    /**
     * 备注
     */
    private String remark;
    /**
     * 订单详情
     */
    private List<Detail> details;
    /**
     * 客户姓名
     */
    private String customerName;

    public BigDecimal getPaid() {
        return paid;
    }

    public void setPaid(BigDecimal paid) {
        this.paid = paid;
    }

    public BigDecimal getArrears() {
        return arrears;
    }

    public void setArrears(BigDecimal arrears) {
        this.arrears = arrears;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    @Transient
    public List<Detail> getDetails() {
        return details;
    }

    public void setDetails(List<Detail> details) {
        this.details = details;
    }

    @Id
    @GeneratedValue
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getCusId() {
        return cusId;
    }

    public void setCusId(long cusId) {
        this.cusId = cusId;
    }


    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getDeposit() {
        return deposit;
    }

    public void setDeposit(BigDecimal deposit) {
        this.deposit = deposit;
    }

    public BigDecimal getAdvance() {
        return advance;
    }

    public void setAdvance(BigDecimal advance) {
        this.advance = advance;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "id=" + id +
                ", cusId=" + cusId +
                ", price=" + price +
                ", deposit=" + deposit +
                ", advance=" + advance +
                ", arrears=" + arrears +
                ", discount=" + discount +
                ", paid=" + paid +
                ", remark='" + remark + '\'' +
                ", details=" + details +
                ", customerName='" + customerName + '\'' +
                '}';
    }
}
